<?php
	require_once("_inc/functions.php");
	// require_once("form_functions.php");
	require_once("_inc/connection.php");
	
	// IT WORK !---- Disable page cache
	// Date in the past 

	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
	// always modified 
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); 
	// HTTP/1.1 
	header("cache-Control: no-store, no-cache, must-revalidate"); 
	header("cache-Control: post-check=0, pre-check=0", false); 
	// HTTP/1.0 
	header("Pragma: no-cache");
	header("Cache-Control: private, max-age=0, must-revalidate");

	if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
	}else {
		if ($_SERVER['REMOTE_ADDR']!="192.168.10.254") {
			$ip = $_SERVER['REMOTE_ADDR'];
		}
	}


	// echo "<pre>";
	// print_r($_SERVER);
	// echo "</pre>";


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="cache-control" content="no-store">
	<meta http-equiv="pragma" content="no-cach">
	<title>Your Title</title>
	<meta name="robots" content="noarchive" />
	<meta name="robots" content="index, follow" />
	<!-- <link href="/_image/site/<?php
		// echo "favicon."; echo filemtime("{$_SERVER['DOCUMENT_ROOT']}/_image/site/favicon.ico");
	?>.ico" rel="shortcut icon" type="image/x-icon" /> -->
	<link href="/_css/main.css?<?php echo time(); ?>" media="screen" rel="stylesheet" type="text/css" />
	<script src="/_js/jquery.js?<?php echo time(); ?>" type="text/javascript" charset="utf-8"></script>
	<script src="/_js/jjson.js?<?php echo time(); ?>" type="text/javascript" charset="utf-8"></script>
	<script src="/_js/jf.js?<?php echo time(); ?>" type="text/javascript" charset="utf-8"></script>
	<script src="/_js/botoon.js?<?php echo time(); ?>" type="text/javascript" charset="utf-8"></script>
	<script src="/_js/jtimer.js?<?php echo time(); ?>" type="text/javascript" charset="utf-8"></script>

</head>
<body>
	<?php if (!logged_in($ip)): ?>
		<div id="login" class="standard_form">
			<form id="login_form" action="" method="post" onsubmit="return false;">
			<div class="error_box" id="login_failed" style="display:none; position:absolute;">invalid password please try again.</div>
			<label for="password_field">please enter password for internet access<br />
			  <input class="text" id="password_field" name="password" style="width: 25em;" tabindex="2" type="password" value="" />
			</label>
			<label for="user_submit">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td>
							<input id="user_submit" name="submit" tabindex="3" class='submit' type="submit" value="Login" />
						</td>
						<td>&nbsp;&nbsp;<img src="/_images/indicator_blue_small.gif" alt="loading" id='loading'>&nbsp;&nbsp;</td>
						<td><p id='failed' style='display:none;'>incorrect password please try again</p><p id='success' style='display:none;'> please wait while redirecting...</p></td>
					</tr>
				</table>
			</label>
			  <input name="referer" type="hidden" value="<?php echo "{$_SERVER['HTTP_REFERER']}"; ?>" />
			</form>
		</div>
	<?php else: ?>
		<div id="login" class="standard_form">
			<form id="disconnect" action="" method="post" onsubmit="return false;">
			<label for="password_field">you are currently logged in, click <a href="/logout" class='logout'>Logout</a> to disconnect<br />
			</label>
			<label>&nbsp;</label>
			</form>
		</div>
	<?php endif ?>

</body>
</html>